From e8a29f90d1911856ffd6fa8b2b85bb4bcc36217e Mon Sep 17 00:00:00 2001 From: Corey Berla Date: Fri, 6 Jan 2023 20:12:10 -0800 Subject: [PATCH] calendar: Only apply the marked_day to the current month The marked day gets applied to the current month, and either the previous or subsequent month if they are visible within the current month. This doesn't make any sense and likely was an accidental regression in a6f9052cf1c1c7b4224834ed18a63e70477d8729. Clarify the docs. --- gtk/gtkcalendar.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 6f9e80653c..c671fb1185 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -1438,7 +1438,8 @@ gtk_calendar_select_day (GtkCalendar *calendar, else gtk_widget_remove_css_class (label, "other-month"); - if (calendar->marked_date[day-1]) + if (calendar->marked_date[day-1] && + calendar->day_month[y][x] == MONTH_CURRENT) gtk_widget_set_state_flags (label, GTK_STATE_FLAG_CHECKED, FALSE); else gtk_widget_unset_state_flags (label, GTK_STATE_FLAG_CHECKED); @@ -1538,7 +1539,7 @@ gtk_calendar_clear_marks (GtkCalendar *calendar) * @calendar: a `GtkCalendar` * @day: the day number to mark between 1 and 31. * - * Places a visual marker on a particular day. + * Places a visual marker on a particular day of the current month. */ void gtk_calendar_mark_day (GtkCalendar *calendar, -- 2.30.2